package com.Util;

import javax.servlet.http.HttpServletRequest;

import com.entity.RequestBean;

public class RequestUtil {

	public static RequestBean getRequestParam(HttpServletRequest request){
		RequestBean req = new RequestBean();
		if(!CommonUtil.isNull(request.getParameter("_search"))){
			req.set_search(request.getParameter("_search"));
		}else{
			req.set_search("");
		}
		
		if(!CommonUtil.isNull(request.getParameter("rows"))){
			req.setRows(Integer.parseInt(request.getParameter("rows")));
		}else{
			req.setRows(0);
		}
		
		
		if(!CommonUtil.isNull(request.getParameter("page"))){
			req.setPage(Integer.parseInt(request.getParameter("page")));
		}else{
			req.setPage(0);
		}
	
		if(!CommonUtil.isNull(request.getParameter("sord"))){
			req.setSord(request.getParameter("sord"));
		}else{
			req.setSord("0");
		}
		if(!CommonUtil.isNull(request.getParameter("sidx"))){
			req.setSidx(request.getParameter("sidx"));
		}else{
			req.setSidx("0");
		}
		return req;
	}
}
